<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:easy="http://easy.widgets.com">

     <script >

      //<![CDATA[
       function retornaCEPFormatado(evento){
           var Campo;

        if (document.all) // Internet Explorer
           Campo = evento.srcElement;
        else // Nestcape, Mozzila
            Campo = evento.target;
          
        var vr = new String(Campo.value);
        if (vr != ""){
            vr = vr.replace("-", "");
            Campo.value = vr.substr(0,5) + '-' + vr.substr(5,3);
        }
}
          //]]>
    </script>
     <h:inputText  value="#{value}" maxlength="9" size="9" onkeyup="return retornaCEPFormatado(event)"/>

</ui:composition>